<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
window.onload=function()
{
		var oUl = document.getElementById('ul1');
	 for(var i =0; i < oUl.childNodes.length;i++)
			{
					//nodeType 3 是文本节点
					//oUl.childNodes[i].style.background = 'red';
				if(oUl.childNodes[i].nodeType==1)
				{
						oUl.childNodes[i].style.background = 'red';
				}
			}
};
</script>
</head>

<body>
<ul id="ul1">
	<li></li>
	<li></li>
</ul>
</body>
</html>
